package WinterFlower;

import java.util.Random;
import java.util.UUID;

/**
 * @author ZJM
 * @version 1.0
 * @since 2022-07-14 18:54:59
 */
public class UseRandom {
    public static void main(String[] args) {
        Random random = new Random();
//        for (int i = 0; i <20 ; i++) {
//            System.out.println(random.nextInt(100)+1);
//        }
//    }
//        给文件起名的时候，如果唯一，通常携带一串数字 16进制的 32位  64位
        String fileName = "面向对象总结.doc";
        for (int i = 1; i <=10 ; i++) {
            String  uniqueName = UUID.randomUUID().toString()+fileName;

            System.out.println(uniqueName);
        }

        String [] names = {"张三","李四","王二麻子","Jack","Lucky"};
        for (int i = 1; i <=5 ; i++) {
            System.out.println("第"+i+"次，幸运者是："+names[random.nextInt(names.length)]);

        }

    }
}
